package com.bw;

import com.alibaba.fastjson.JSON;
import com.bw.entity.User;
import com.bw.service.UserService;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.support.SpringBootServletInitializer;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.transaction.annotation.EnableTransactionManagement;
import org.springframework.util.StringUtils;

import java.util.List;

@SpringBootApplication(scanBasePackages={"com.bw.controller","com.bw.service","com.bw.Interceptor","com.bw.commons"})
@MapperScan(basePackages={"com.bw.dao"})
@EnableTransactionManagement
public class Springboot1511sApplication extends SpringBootServletInitializer {




	public static void main(String[] args) {
		SpringApplication.run(Springboot1511sApplication.class, args);
	}


	@Autowired
	UserService userService;


	@Autowired
    StringRedisTemplate redisTemplate;
//	@Override
//	public void run(String... strings) throws Exception {
//		List<User> users = userService.selectByCondition(new User());
//		System.out.println(JSON.toJSONString(users));
//		System.out.println();
//        redisTemplate.opsForValue().set("string","n");
//
//        redisTemplate.opsForHash().put("hash","name","zhangsan");
//        redisTemplate.opsForHash().put("hash","age","name");
//
////		redisTemplate.opsForHash().put("hash","name","张三");
////		redisTemplate.opsForList().leftPush("list","1");
////		redisTemplate.opsForList().leftPush("list","2");
////		redisTemplate.opsForSet().add("set","1");
////		redisTemplate.opsForSet().add("set","2");
//////		redisTemplate.opsForZSet().add("set","1",1);
//	}
}
